home *** CD-ROM | disk | FTP | other *** search
- #ifndef FWSTRMRW_H
- #define FWSTRMRW_H
- //========================================================================================
- //
- // File: FWStrmRW.h
- // Release Version: $ 1.0d11 $
- //
- // Copyright: (c) 1993, 1995 by Apple Computer, Inc., all rights reserved.
- //
- //========================================================================================
-
- #ifndef FWASINKS_H
- #include "FWASinks.h"
- #endif
-
- #ifndef FWSTRMF_H
- #include "FWStrmF.h"
- #endif
-
- #if FW_LIB_EXPORT_PRAGMAS
- #pragma lib_export on
- #endif
-
- //========================================================================================
- // Forward class declarations
- //========================================================================================
-
- class FW_CLASS_ATTR FW_CObjectRegistry;
-
-
- //========================================================================================
- // CLASS FW_CReadableStream
- //========================================================================================
-
- class FW_CLASS_ATTR FW_CReadableStream FW_AUTO_DESTRUCT_OBJECT
- {
-
- public:
-
- typedef void* (* InputFunction)(FW_CReadableStream& readableStream);
-
- FW_CReadableStream(FW_CSink* sink,
- FW_CReadableStreamFormatter* formatter = 0,
- FW_CObjectRegistry* objectRegistry = 0);
- virtual ~ FW_CReadableStream();
-
- void* InputObject(InputFunction inputFunction);
- // Reads object data for static and dynamic classes from the readableStream.
-
- FW_CSink* GetSink() const;
-
- // ----- void
-
- void Read(void* buffer,
- long count) const;
- // Read 'count' bytes into buffer.
-
- // ----- char
-
- //#if !defined(__BORLANDC__)
- // Borland doesn't treat char, unsigned char and signed char as three distinct types
- // as it should. (ARM pg. 22)
- void Read(char* buffer,
- long count) const;
- // Read 'count' chars into buffer.
-
- const FW_CReadableStream& operator>>(char& aChar) const;
- // Read char.
- //#endif
-
- const FW_CReadableStream& operator>>(char* nullTerminatedString) const;
- // Read a null-terminated string.
-
- char GetChar() const;
- // Get char.
-
- // ----- signed char
-
- void Read(signed char* buffer,
- long count) const;
- // Read 'count' signed chars into buffer.
-
- const FW_CReadableStream& operator>>(signed char& aChar) const;
- // Read char.
-
- signed char GetSignedChar() const;
- // Get signed char.
-
- // ----- unsigned char
-
- void Read(unsigned char* buffer,
- long count) const;
- // Read 'count' unsigned chars into buffer.
-
- const FW_CReadableStream& operator>>(unsigned char& aChar) const;
- // Read char.
-
- unsigned char GetUnsignedChar() const;
- // Get unsigned char.
-
- // ----- int
-
- void Read(int* buffer,
- long count) const;
- // Read 'count' ints into buffer.
-
- const FW_CReadableStream& operator>>(int& aInt) const;
- // Read int.
-
- int GetInt() const;
- // Get int.
-
- // ----- unsigned int
-
- void Read(unsigned int* buffer,
- long count) const;
- // Read 'count' unsigned ints into buffer.
-
- const FW_CReadableStream& operator>>(unsigned int& unsignedInt) const;
- // Read unsigned int.
-
- unsigned int GetUnsignedInt() const;
- // Get unsigned int.
-
- // ----- short
-
- void Read(short* buffer,
- long count) const;
- // Read 'count' shorts into buffer.
-
- const FW_CReadableStream& operator>>(short& aShort) const;
- // Read short.
-
- short GetShort() const;
- // Get short.
-
- // ----- unsigned short
-
- void Read(unsigned short* buffer,
- long count) const;
- // Read 'count' unsigned shorts into buffer.
-
- const FW_CReadableStream& operator>>(unsigned short& unsignedShort) const;
- // Read unsigned short.
-
- unsigned short GetUnsignedShort() const;
- // Get unsigned short.
-
- // ----- long
-
- void Read(long* buffer,
- long count) const;
- // Read 'count' longs into buffer.
-
- const FW_CReadableStream& operator>>(long& aLong) const;
- // Read long.
-
- long GetLong() const;
- // Get long.
-
- // ----- unsigned long
-
- void Read(unsigned long* buffer,
- long count) const;
- // Read 'count' unsigned longs into buffer.
-
- const FW_CReadableStream& operator>>(unsigned long& unsignedLong) const;
- // Read unsigned long.
-
- unsigned long GetUnsignedLong() const;
- // Get unsigned long.
-
- // ----- float
-
- void Read(float* buffer,
- long count) const;
- // Read 'count' floats into buffer.
-
- const FW_CReadableStream& operator>>(float& aFloat) const;
- // Read float.
-
- float GetFloat() const;
- // Get float.
-
- // ----- double
-
- void Read(double* buffer,
- long count) const;
- // Read 'count' doubles into buffer.
-
- const FW_CReadableStream& operator>>(double& aDouble) const;
- // Read double.
-
- double GetDouble() const;
- // Get double.
-
- #ifdef FW_COMPILER_SUPPORTS_LONG_DOUBLE
-
- // ----- long double
-
- void Read(long double* buffer,
- long count) const;
- // Read 'count' long doubles into buffer.
-
- const FW_CReadableStream& operator>>(long double& aDouble) const;
- // Read long double.
-
- long double GetLongDouble() const;
- // Get long double.
- #endif
-
- protected:
-
- FW_CSink* fSink;
- FW_Boolean fStreamCreatedFormatter;
- FW_CReadableStreamFormatter* fFormatter;
- FW_Boolean fArchiveCreatedObjectRegistry;
- FW_CObjectRegistry* fObjectRegistry;
-
- private:
- FW_CReadableStream(const FW_CReadableStream& theStream);
- FW_CReadableStream& operator=(const FW_CReadableStream& theStream);
- // Can't copy instances of this class.
- };
-
- //----------------------------------------------------------------------------------------
- // FW_CReadableStream::GetSink
- //----------------------------------------------------------------------------------------
-
- inline FW_CSink* FW_CReadableStream::GetSink() const
- {
- return fSink;
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CReadableStream::Read
- //----------------------------------------------------------------------------------------
-
- inline void FW_CReadableStream::Read(void* buffer,
- long count) const
- {
- fFormatter->ReadBytes(*fSink, buffer, count);
- }
-
- //#if !defined(__BORLANDC__)
- //----------------------------------------------------------------------------------------
- // FW_CReadableStream::Read
- //----------------------------------------------------------------------------------------
-
- inline void FW_CReadableStream::Read(char* buffer,
- long count) const
- {
- fFormatter->ReadChars(*fSink, buffer, count);
- }
- //#endif
-
- //#if !defined(__BORLANDC__)
- //----------------------------------------------------------------------------------------
- // FW_CReadableStream::operator >>
- //----------------------------------------------------------------------------------------
-
- inline const FW_CReadableStream& FW_CReadableStream::operator>>(char& aChar) const
- {
- fFormatter->ReadChars(*fSink, &aChar, 1);
- return *this;
- }
- //#endif
-
- //----------------------------------------------------------------------------------------
- // FW_CReadableStream::operator >>
- //----------------------------------------------------------------------------------------
-
- inline const FW_CReadableStream& FW_CReadableStream::operator>>(char* nullTerminatedString) const
- {
- fFormatter->ReadNullTerminatedString(*fSink, nullTerminatedString);
- return *this;
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CReadableStream::GetChar
- //----------------------------------------------------------------------------------------
-
- inline char FW_CReadableStream::GetChar() const
- {
- char x;
- fFormatter->ReadChars(*fSink, &x, 1);
- return x;
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CReadableStream::Read
- //----------------------------------------------------------------------------------------
-
- inline void FW_CReadableStream::Read(signed char* buffer,
- long count) const
- {
- fFormatter->ReadSignedChars(*fSink, buffer, count);
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CReadableStream::operator >>
- //----------------------------------------------------------------------------------------
-
- inline const FW_CReadableStream& FW_CReadableStream::operator>>(signed char& aChar) const
- {
- fFormatter->ReadSignedChars(*fSink, &aChar, 1);
- return *this;
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CReadableStream::GetSignedChar
- //----------------------------------------------------------------------------------------
-
- inline signed char FW_CReadableStream::GetSignedChar() const
- {
- signed char x;
- fFormatter->ReadSignedChars(*fSink, &x, 1);
- return x;
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CReadableStream::Read
- //----------------------------------------------------------------------------------------
-
- inline void FW_CReadableStream::Read(unsigned char* buffer,
- long count) const
- {
- fFormatter->ReadUnsignedChars(*fSink, buffer, count);
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CReadableStream::operator >>
- //----------------------------------------------------------------------------------------
-
- inline const FW_CReadableStream& FW_CReadableStream::operator>>(unsigned char& aChar) const
- {
- fFormatter->ReadUnsignedChars(*fSink, &aChar, 1);
- return *this;
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CReadableStream::GetUnsignedChar
- //----------------------------------------------------------------------------------------
-
- inline unsigned char FW_CReadableStream::GetUnsignedChar() const
- {
- unsigned char x;
- fFormatter->ReadUnsignedChars(*fSink, &x, 1);
- return x;
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CReadableStream::Read
- //----------------------------------------------------------------------------------------
-
- inline void FW_CReadableStream::Read(int* buffer,
- long count) const
- {
- fFormatter->ReadInts(*fSink, buffer, count);
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CReadableStream::operator >>
- //----------------------------------------------------------------------------------------
-
- inline const FW_CReadableStream& FW_CReadableStream::operator>>(int& aInt) const
- {
- fFormatter->ReadInts(*fSink, &aInt, 1);
- return *this;
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CReadableStream::GetInt
- //----------------------------------------------------------------------------------------
-
- inline int FW_CReadableStream::GetInt() const
- {
- int x;
- fFormatter->ReadInts(*fSink, &x, 1);
- return x;
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CReadableStream::Read
- //----------------------------------------------------------------------------------------
-
- inline void FW_CReadableStream::Read(unsigned int* buffer,
- long count) const
- {
- fFormatter->ReadUnsignedInts(*fSink, buffer, count);
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CReadableStream::operator >>
- //----------------------------------------------------------------------------------------
-
- inline const FW_CReadableStream& FW_CReadableStream::operator>>(unsigned int& unsignedInt) const
- {
- fFormatter->ReadUnsignedInts(*fSink, &unsignedInt, 1);
- return *this;
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CReadableStream::GetUnsignedInt
- //----------------------------------------------------------------------------------------
-
- inline unsigned int FW_CReadableStream::GetUnsignedInt() const
- {
- unsigned int x;
- fFormatter->ReadUnsignedInts(*fSink, &x, 1);
- return x;
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CReadableStream::Read
- //----------------------------------------------------------------------------------------
-
- inline void FW_CReadableStream::Read(short* buffer,
- long count) const
- {
- fFormatter->ReadShorts(*fSink, buffer, count);
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CReadableStream::operator >>
- //----------------------------------------------------------------------------------------
-
- inline const FW_CReadableStream& FW_CReadableStream::operator>>(short& aShort) const
- {
- fFormatter->ReadShorts(*fSink, &aShort, 1);
- return *this;
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CReadableStream::GetShort
- //----------------------------------------------------------------------------------------
-
- inline short FW_CReadableStream::GetShort() const
- {
- short x;
- fFormatter->ReadShorts(*fSink, &x, 1);
- return x;
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CReadableStream::Read
- //----------------------------------------------------------------------------------------
-
- inline void FW_CReadableStream::Read(unsigned short* buffer,
- long count) const
- {
- fFormatter->ReadUnsignedShorts(*fSink, buffer, count);
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CReadableStream::operator >>
- //----------------------------------------------------------------------------------------
-
- inline const FW_CReadableStream& FW_CReadableStream::operator>>(unsigned short& unsignedShort) const
- {
- fFormatter->ReadUnsignedShorts(*fSink, &unsignedShort, 1);
- return *this;
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CReadableStream::GetUnsignedShort
- //----------------------------------------------------------------------------------------
-
- inline unsigned short FW_CReadableStream::GetUnsignedShort() const
- {
- unsigned short x;
- fFormatter->ReadUnsignedShorts(*fSink, &x, 1);
- return x;
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CReadableStream::Read
- //----------------------------------------------------------------------------------------
-
- inline void FW_CReadableStream::Read(long* buffer,
- long count) const
- {
- fFormatter->ReadLongs(*fSink, buffer, count);
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CReadableStream::operator >>
- //----------------------------------------------------------------------------------------
-
- inline const FW_CReadableStream& FW_CReadableStream::operator>>(long& aLong) const
- {
- fFormatter->ReadLongs(*fSink, &aLong, 1);
- return *this;
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CReadableStream::GetLong
- //----------------------------------------------------------------------------------------
-
- inline long FW_CReadableStream::GetLong() const
- {
- long x;
- fFormatter->ReadLongs(*fSink, &x, 1);
- return x;
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CReadableStream::Read
- //----------------------------------------------------------------------------------------
-
- inline void FW_CReadableStream::Read(unsigned long* buffer,
- long count) const
- {
- fFormatter->ReadUnsignedLongs(*fSink, buffer, count);
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CReadableStream::operator >>
- //----------------------------------------------------------------------------------------
-
- inline const FW_CReadableStream& FW_CReadableStream::operator>>(unsigned long& unsignedLong) const
- {
- fFormatter->ReadUnsignedLongs(*fSink, &unsignedLong, 1);
- return *this;
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CReadableStream::GetUnsignedLong
- //----------------------------------------------------------------------------------------
-
- inline unsigned long FW_CReadableStream::GetUnsignedLong() const
- {
- unsigned long x;
- fFormatter->ReadUnsignedLongs(*fSink, &x, 1);
- return x;
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CReadableStream::Read
- //----------------------------------------------------------------------------------------
-
- inline void FW_CReadableStream::Read(float* buffer,
- long count) const
- {
- fFormatter->ReadFloats(*fSink, buffer, count);
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CReadableStream::operator >>
- //----------------------------------------------------------------------------------------
-
- inline const FW_CReadableStream& FW_CReadableStream::operator>>(float& aFloat) const
- {
- fFormatter->ReadFloats(*fSink, &aFloat, 1);
- return *this;
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CReadableStream::GetFloat
- //----------------------------------------------------------------------------------------
-
- inline float FW_CReadableStream::GetFloat() const
- {
- float x;
- fFormatter->ReadFloats(*fSink, &x, 1);
- return x;
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CReadableStream::Read
- //----------------------------------------------------------------------------------------
-
- inline void FW_CReadableStream::Read(double* buffer,
- long count) const
- {
- fFormatter->ReadDoubles(*fSink, buffer, count);
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CReadableStream::operator >>
- //----------------------------------------------------------------------------------------
-
- inline const FW_CReadableStream& FW_CReadableStream::operator>>(double& aDouble) const
- {
- fFormatter->ReadDoubles(*fSink, &aDouble, 1);
- return *this;
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CReadableStream::GetDouble
- //----------------------------------------------------------------------------------------
-
- inline double FW_CReadableStream::GetDouble() const
- {
- double x;
- fFormatter->ReadDoubles(*fSink, &x, 1);
- return x;
- }
-
- #ifdef FW_COMPILER_SUPPORTS_LONG_DOUBLE
- //----------------------------------------------------------------------------------------
- // FW_CReadableStream::Read
- //----------------------------------------------------------------------------------------
-
- inline void FW_CReadableStream::Read(long double* buffer,
- long count) const
- {
- fFormatter->ReadLongDoubles(*fSink, buffer, count);
- }
- #endif
-
- #ifdef FW_COMPILER_SUPPORTS_LONG_DOUBLE
- //----------------------------------------------------------------------------------------
- // FW_CReadableStream::operator >>
- //----------------------------------------------------------------------------------------
-
- inline const FW_CReadableStream& FW_CReadableStream::operator>>(long double& aDouble) const
- {
- fFormatter->ReadLongDoubles(*fSink, &aDouble, 1);
- return *this;
- }
- #endif
-
- #ifdef FW_COMPILER_SUPPORTS_LONG_DOUBLE
- //----------------------------------------------------------------------------------------
- // FW_CReadableStream::GetLongDouble
- //----------------------------------------------------------------------------------------
-
- inline long double FW_CReadableStream::GetLongDouble() const
- {
- long double x;
- fFormatter->ReadLongDoubles(*fSink, &x, 1);
- return x;
- }
- #endif
-
-
- //========================================================================================
- // CLASS FW_CWritableStream
- //========================================================================================
-
- class FW_CLASS_ATTR FW_CWritableStream FW_AUTO_DESTRUCT_OBJECT
- {
-
- public:
-
- typedef void (* OutputFunction)(FW_CWritableStream & stream, const void *object);
-
- FW_CWritableStream(FW_CSink* sink,
- FW_CWritableStreamFormatter* formatter = 0,
- FW_CObjectRegistry* objectRegistry = 0);
- ~ FW_CWritableStream();
-
- void OutputObject(OutputFunction outputFunction,
- const void* object);
- // Writes object data for static and dynamic classes to the writableStream.
-
- FW_CSink* GetSink() const;
-
- // ----- void
-
- void Write(const void* buffer,
- long count) const;
- // Write 'count' bytes from buffer.
-
- //#if !defined(__BORLANDC__)
- // Borland doesn't treat char, unsigned char and signed char as three distinct types
- // as it should. (ARM pg. 22)
-
- // ----- char
-
- void Write(const char* buffer,
- long count) const;
- // Write 'count' chars from buffer.
-
- const FW_CWritableStream& operator<<(const char &aChar) const;
- // Write char.
- //#endif
-
- const FW_CWritableStream& operator<<(const char *nullTerminatedString) const;
- // Write a null-terminated string.
-
- // ----- signed char
-
- void Write(const signed char* buffer,
- long count) const;
- // Write 'count' signed chars from buffer.
-
- const FW_CWritableStream& operator<<(const signed char &aChar) const;
- // Write signed char.
-
- // ----- unsigned char
-
- void Write(const unsigned char* buffer,
- long count) const;
- // Write 'count' unsigned chars from buffer.
-
- const FW_CWritableStream& operator<<(const unsigned char &aChar) const;
- // Write unsigned char.
-
- // ----- int
-
- void Write(const int* buffer,
- long count) const;
- // Write 'count' ints from buffer.
-
- const FW_CWritableStream& operator<<(const int &aInt) const;
- // Write int.
-
- // ----- unsigned int
-
- void Write(const unsigned int* buffer,
- long count) const;
- // Write 'count' unsigned ints from buffer.
-
- const FW_CWritableStream& operator<<(const unsigned int &unsignedInt) const;
- // Write unsigned int.
-
- // ----- short
-
- void Write(const short* buffer,
- long count) const;
- // Write 'count' shorts from buffer.
-
- const FW_CWritableStream& operator<<(const short &aShort) const;
- // Write short.
-
- // ----- unsigned short
-
- void Write(const unsigned short* buffer,
- long count) const;
- // Write 'count' unsigned shorts from buffer.
-
- const FW_CWritableStream& operator<<(const unsigned short &unsignedShort) const;
- // Write unsigned short.
-
- // ----- long
-
- void Write(const long* buffer,
- long count) const;
- // Write 'count' longs from buffer.
-
- const FW_CWritableStream& operator<<(const long &aLong) const;
- // Write long.
-
- // ----- unsigned long
-
- void Write(const unsigned long* buffer,
- long count) const;
- // Write 'count' unsigned longs from buffer.
-
- const FW_CWritableStream& operator<<(const unsigned long &unsignedLong) const;
- // Write unsigned long.
-
- // ----- float
-
- void Write(const float* buffer,
- long count) const;
- // Write 'count' floats from buffer.
-
- const FW_CWritableStream& operator<<(const float &aFloat) const;
- // Write float.
-
- // ----- double
-
- void Write(const double* buffer,
- long count) const;
- // Write 'count' doubles from buffer.
-
- const FW_CWritableStream& operator<<(const double &aDouble) const;
- // Write double.
-
- #ifdef FW_COMPILER_SUPPORTS_LONG_DOUBLE
-
- // ----- long double
-
- void Write(const long double* buffer,
- long count) const;
- // Write 'count' long doubles from buffer.
-
- const FW_CWritableStream& operator<<(const long double &aDouble) const;
- // Write long double.
- #endif
-
- protected:
-
- FW_CSink* fSink;
- FW_Boolean fStreamCreatedFormatter;
- FW_CWritableStreamFormatter* fFormatter;
- FW_Boolean fArchiveCreatedObjectRegistry;
- FW_CObjectRegistry* fObjectRegistry;
-
- private:
- FW_CWritableStream(const FW_CWritableStream& theStream);
- FW_CWritableStream& operator=(const FW_CWritableStream& theStream);
- // Can't copy instances of this class.
- };
-
- //----------------------------------------------------------------------------------------
- // FW_CWritableStream::GetSink
- //----------------------------------------------------------------------------------------
-
- inline FW_CSink* FW_CWritableStream::GetSink() const
- {
- return fSink;
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CWritableStream::Write
- //----------------------------------------------------------------------------------------
-
- inline void FW_CWritableStream::Write(const void* buffer,
- long count) const
- {
- fFormatter->WriteBytes(*fSink, buffer, count);
- }
-
- //#if !defined(__BORLANDC__)
- //----------------------------------------------------------------------------------------
- // FW_CWritableStream::Write
- //----------------------------------------------------------------------------------------
-
- inline void FW_CWritableStream::Write(const char* buffer,
- long count) const
- {
- fFormatter->WriteChars(*fSink, buffer, count);
- }
- //#endif
-
- //#if !defined(__BORLANDC__)
- //----------------------------------------------------------------------------------------
- // FW_CWritableStream::operator <<
- //----------------------------------------------------------------------------------------
-
- inline const FW_CWritableStream& FW_CWritableStream::operator<<(const char &aChar) const
- {
- fFormatter->WriteChars(*fSink, &aChar, 1);
- return *this;
- }
- //#endif
-
- //----------------------------------------------------------------------------------------
- // FW_CWritableStream::operator<<
- //----------------------------------------------------------------------------------------
-
- inline const FW_CWritableStream& FW_CWritableStream::operator<<(const char* nullTerminatedString) const
- {
- fFormatter->WriteNullTerminatedString(*fSink, nullTerminatedString);
- return *this;
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CWritableStream::Write
- //----------------------------------------------------------------------------------------
-
- inline void FW_CWritableStream::Write(const signed char* buffer,
- long count) const
- {
- fFormatter->WriteSignedChars(*fSink, buffer, count);
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CWritableStream::operator <<
- //----------------------------------------------------------------------------------------
-
- inline const FW_CWritableStream& FW_CWritableStream::operator<<(const signed char &aChar) const
- {
- fFormatter->WriteSignedChars(*fSink, &aChar, 1);
- return *this;
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CWritableStream::Write
- //----------------------------------------------------------------------------------------
-
- inline void FW_CWritableStream::Write(const unsigned char* buffer,
- long count) const
- {
- fFormatter->WriteUnsignedChars(*fSink, buffer, count);
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CWritableStream::operator <<
- //----------------------------------------------------------------------------------------
-
- inline const FW_CWritableStream& FW_CWritableStream::operator<<(const unsigned char &aChar) const
- {
- fFormatter->WriteUnsignedChars(*fSink, &aChar, 1);
- return *this;
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CWritableStream::Write
- //----------------------------------------------------------------------------------------
-
- inline void FW_CWritableStream::Write(const int* buffer,
- long count) const
- {
- fFormatter->WriteInts(*fSink, buffer, count);
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CWritableStream::operator <<
- //----------------------------------------------------------------------------------------
-
- inline const FW_CWritableStream& FW_CWritableStream::operator<<(const int &aInt) const
- {
- fFormatter->WriteInts(*fSink, &aInt, 1);
- return *this;
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CWritableStream::Write
- //----------------------------------------------------------------------------------------
-
- inline void FW_CWritableStream::Write(const unsigned int* buffer,
- long count) const
- {
- fFormatter->WriteUnsignedInts(*fSink, buffer, count);
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CWritableStream::operator <<
- //----------------------------------------------------------------------------------------
-
- inline const FW_CWritableStream& FW_CWritableStream::operator<<(const unsigned int &unsignedInt) const
- {
- fFormatter->WriteUnsignedInts(*fSink, &unsignedInt, 1);
- return *this;
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CWritableStream::Write
- //----------------------------------------------------------------------------------------
-
- inline void FW_CWritableStream::Write(const short* buffer,
- long count) const
- {
- fFormatter->WriteShorts(*fSink, buffer, count);
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CWritableStream::operator <<
- //----------------------------------------------------------------------------------------
-
- inline const FW_CWritableStream& FW_CWritableStream::operator<<(const short &aShort) const
- {
- fFormatter->WriteShorts(*fSink, &aShort, 1);
- return *this;
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CWritableStream::Write
- //----------------------------------------------------------------------------------------
-
- inline void FW_CWritableStream::Write(const unsigned short* buffer,
- long count) const
- {
- fFormatter->WriteUnsignedShorts(*fSink, buffer, count);
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CWritableStream::operator <<
- //----------------------------------------------------------------------------------------
-
- inline const FW_CWritableStream& FW_CWritableStream::operator<<(const unsigned short &unsignedShort) const
- {
- fFormatter->WriteUnsignedShorts(*fSink, &unsignedShort, 1);
- return *this;
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CWritableStream::Write
- //----------------------------------------------------------------------------------------
-
- inline void FW_CWritableStream::Write(const long* buffer,
- long count) const
- {
- fFormatter->WriteLongs(*fSink, buffer, count);
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CWritableStream::operator <<
- //----------------------------------------------------------------------------------------
-
- inline const FW_CWritableStream& FW_CWritableStream::operator<<(const long &aLong) const
- {
- fFormatter->WriteLongs(*fSink, &aLong, 1);
- return *this;
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CWritableStream::Write
- //----------------------------------------------------------------------------------------
-
- inline void FW_CWritableStream::Write(const unsigned long* buffer,
- long count) const
- {
- fFormatter->WriteUnsignedLongs(*fSink, buffer, count);
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CWritableStream::operator <<
- //----------------------------------------------------------------------------------------
-
- inline const FW_CWritableStream& FW_CWritableStream::operator<<(const unsigned long &unsignedLong) const
- {
- fFormatter->WriteUnsignedLongs(*fSink, &unsignedLong, 1);
- return *this;
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CWritableStream::Write
- //----------------------------------------------------------------------------------------
-
- inline void FW_CWritableStream::Write(const float* buffer,
- long count) const
- {
- fFormatter->WriteFloats(*fSink, buffer, count);
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CWritableStream::operator <<
- //----------------------------------------------------------------------------------------
-
- inline const FW_CWritableStream& FW_CWritableStream::operator<<(const float &aFloat) const
- {
- fFormatter->WriteFloats(*fSink, &aFloat, 1);
- return *this;
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CWritableStream::Write
- //----------------------------------------------------------------------------------------
-
- inline void FW_CWritableStream::Write(const double* buffer,
- long count) const
- {
- fFormatter->WriteDoubles(*fSink, buffer, count);
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CWritableStream::operator <<
- //----------------------------------------------------------------------------------------
-
- inline const FW_CWritableStream& FW_CWritableStream::operator<<(const double &aDouble) const
- {
- fFormatter->WriteDoubles(*fSink, &aDouble, 1);
- return *this;
- }
-
- #ifdef FW_COMPILER_SUPPORTS_LONG_DOUBLE
- //----------------------------------------------------------------------------------------
- // FW_CWritableStream::Write
- //----------------------------------------------------------------------------------------
-
- inline void FW_CWritableStream::Write(const long double* buffer,
- long count) const
- {
- fFormatter->WriteLongDoubles(*fSink, buffer, count);
- }
- #endif
-
- #ifdef FW_COMPILER_SUPPORTS_LONG_DOUBLE
- //----------------------------------------------------------------------------------------
- // FW_CWritableStream::operator <<
- //----------------------------------------------------------------------------------------
-
- inline const FW_CWritableStream& FW_CWritableStream::operator<<(const long double &aDouble) const
- {
- fFormatter->WriteLongDoubles(*fSink, &aDouble, 1);
- return *this;
- }
- #endif
-
- #if FW_LIB_EXPORT_PRAGMAS
- #pragma lib_export off
- #endif
-
- #endif
-